<div class="tree" id="fleet_tree">
	<ul style="position:relative; left:-10px;">
		<li id="surveys" rel="root" class="open">
        	<a style="background-image:url(<?php echo SYSICONS_URL; ?>treemenu/folder_16.gif)" href="?con=<?php echo $_REQUEST['con']; ?>"><?php echo ucfirst($txt->getWord('fleet')); ?></a>
			<?php  echo $fleetAdmin->getFleetMenuHTML(); ?>
        </li>
    </ul>
</div>
<div class="tree" id="menu_tree"></div>

<script type="text/javascript">
	
	function load_tree_menu() 
	{
		var ctrldown = false;
		var fleet_down = 0;
		var sec_down = 0;
		
		jQuery.cookie('fleet_down', '0', { expires: 1 });
		
		jQuery("#fleet_tree").tree(
		{
			ui: 
			{ 
				animation : 100, 
				dots : true,
        		context : []
			},
			rules: 
			{
				draggable : "none",
				creatable : "none",
				renameable : "none",
				deletable : "none"
			},
			<?php 
			if($_REQUEST['ship'] > 0)
			{ echo 'selected : ["#ship_'.$_REQUEST['ship'].'"], '; }

			if($_REQUEST['ship'] > 0)
			{ echo 'open : ["#ship_'.$_REQUEST['ship'].'"] ,'; }
			?>
			callback:
			{
				onchange : function (NODE) 
				{
					if(jQuery.cookie('fleet_down') == '1')
					{ document.location.href = jQuery(NODE).children("a:eq(0)").attr("href"); }
					else
					{ jQuery.cookie('fleet_down', '1', { expires: 1 }); }
				}
			}
		});
	}
</script>